import { useUserStore, useWebConfigStore } from "@/stores";
export const $auth = {
    auth: (options:any) => {
        switch (options.action) {
            case 'user':
                const UserStore = useUserStore();
                return UserStore.hasPermission(options.permission);
            default:
                const WebConfigStore = useWebConfigStore();
                return WebConfigStore.hasPermission(options.permission);
        }
    },
    user: (permission:string|string[]) => {
        const UserStore = useUserStore();
        return UserStore.hasPermission(permission);
    }
}   